#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<vector>
using namespace std;

//https://leetcode.cn/problems/move-zeroes/description/

class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        int des = -1, cur = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            if (nums[cur] == 0) cur++;
            else
            {
                swap(nums[++des], nums[cur++]);
            }

        }
    }
};

